# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
require 'uri'
require 'time'
class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  protect_from_forgery # See ActionController::RequestForgeryProtection for details

  # Scrub sensitive parameters from your log
  # filter_parameter_logging :password

   #for debug
   private
    require 'pp'
    def log *objs
      logger = Logger.new File.join(RAILS_ROOT, 'log', "__#{self.class}.log")
      objs.each { |obj| logger.debug PP.pp(obj, '') }
      nil
   end
end

class BakoheadException < StandardError; end
class ParameterException < BakoheadException; end
class BarcodeRegisteredException < BakoheadException; end
class BarcodeMissingException < BakoheadException; end
class BarcodeCompletedException < BakoheadException; end

